<template>
  <div>
    <!-- 查询、下载PDF、返回 -->
    <!-- <el-row class="header">
      <el-button class="top-btn" type="danger" size="small" @click="goback()"
        >返回</el-button
      >
    </el-row> -->
    <div class="optinos">
      <el-button type="danger" style="margin: 5px 0px" @click="goback()">
        返回
      </el-button>
      <br />
      <el-button @click="goTop" type="info"> 顶部 </el-button>
    </div>
    <!-- 表格 -->
    <el-row>
      <el-card>
        <WellReport :wellName="wellName" :casingSize="casingSize" />
      </el-card>
    </el-row>
  </div>
</template>

<script>
import { getWellCasingSize } from "../../api/module/dataquery.js";
// 没有标明引入哪个文件，会自动找到 reportComponents 下面的 index.vue 文件
import WellReport from "../dataQuery/wellQuery/reportComponents";

export default {
  components: {
    WellReport,
  },
  data() {
    return {
      form: {}, // 前一页的查询条件
      pager: null, // 前一页的页码数
      wellName: "",
      casingSize: "",
      casingSizeOptions: [],
    };
  },
  created() {
    this.form = this.$route.params.filterForm;
    this.pager = this.$route.params.pager;
    this.wellName = this.$route.params.id;
    this.casingSize = this.$route.params.casingSize;
    console.log(this.$route.params);
  },
  methods: {
    /**
     * 作用：返回前一页，并把前一页查询条件返回。
     */
    goback() {
      // this.$router.push({
      //   name: "dataValidate",
      //   params: { filterForm: this.form, pager: this.pager },
      // });
      this.$router.go(-1)
    },
    goTop(){
      document.querySelector("#logo").scrollIntoView(true)
    }
  },
};
</script>

<style scoped>
.header {
  background-color: #eef0f6;
  padding: 5px 10px;
  margin-bottom: 10px;
}
.section {
  margin-bottom: 30px;
  border-bottom: 1px solid black;
}
.optinos {
  position: fixed;
  bottom: 10%;
  right: 0px;
  z-index: 999;
}
</style>
